/*
 * @Copyright: 2017 www.yyfax.com Inc. All rights reserved.
 */
package com.yyfax.pay.order.model.to;

import org.apache.commons.lang3.StringUtils;

import com.yyfax.framework.exception.YYException;
import com.yyfax.framework.yyfax.enums.RspCodeEnum;
import com.yyfax.pay.common.model.to.YYPayParams;

/**
 * 查询批量代付结果 请求参数
 * 
 * @author buyi
 * @date 2017-04-21 09:09:40
 * @since v1.0.0
 */
@SuppressWarnings("serial")
public class QueryPayoutBatchOrderParams extends YYPayParams {
	private String serverIp;
	private String merchantCode; // 商户编号
	private String orderId; // 商户订单号
	private String batchDate; // 批次日期
	private String batchNo; // 批次号

	public String getServerIp() {
		return serverIp;
	}

	public void setServerIp(String serverIp) {
		this.serverIp = serverIp;
	}

	public String getMerchantCode() {
		return merchantCode;
	}

	public void setMerchantCode(String merchantCode) {
		this.merchantCode = merchantCode;
	}

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public String getBatchDate() {
		return batchDate;
	}

	public void setBatchDate(String batchDate) {
		this.batchDate = batchDate;
	}

	public String getBatchNo() {
		return batchNo;
	}

	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}

	@Override
	public boolean validate() throws Exception {

		if (StringUtils.isBlank(this.serverIp)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'serverIp'不能为空");
		}

		if (StringUtils.isBlank(this.merchantCode)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'merchantCode'不能为空");
		}

		if (StringUtils.isBlank(this.orderId)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'orderId'不能为空");
		}

		if (StringUtils.isBlank(this.batchDate)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'batchDate'不能为空");
		}

		if (StringUtils.isBlank(this.batchNo)) {
			throw new YYException(RspCodeEnum.COMMON_ERROR_PARAMETER_INVALID, "参数 'batchNo'不能为空");
		}

		return true;
	}

	@Override
	public String[] signFields() {
		return new String[] { "serverIp", "merchantCode", "orderId", "batchDate", "batchNo" };
	}
}
